Method and apparatus for encoding/decoding video signal

ABSTRACT

A video encoding/decoding apparatus according to the present invention acquires motion vector refinement information, performs motion compensation on the basis of a motion vector of a current block, refines the motion vector of the current block using at least one or both of the motion vector refinement information and the output of the motion compensation, and performs motion compensation using the refined motion vector.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This is a continuation of U.S. application Ser. No. 16/993,628 filedAug. 14, 2020, which is a continuation of U.S. application Ser. No.16/087,787 filed Sep. 24, 2018, which is a U.S. National StageApplication of International Application No. PCT/KR2017/003082, filed onMar. 22, 2017, which claims the benefit of Korean Patent Application No.10-2016-0035090, filed on Mar. 24, 2016, Korean Patent Application No.10-2016-0035674, filed on Mar. 25, 2016, Korean Patent Application No.10-2016-0049485, filed on Apr. 22, 2016, Korean Patent Application No.10-2016-0054607, filed on May 3, 2016, and Korean Patent Application No.10-2016-0055370, filed on May 4, 2016, in the Korean IntellectualProperty Office, the entire disclosures of which are incorporated byreference for all purposes.

TECHNICAL FIELD

The present invention relates to a method and apparatus for encoding ordecoding a video signal.

BACKGROUND ART

Recently, the demand for high-resolution and high-quality videos such ashigh-definition or ultra-high-definition videos has increased in variousfields. As the videos are improved in resolution and quality, the amountof data of videos increases compared to conventional videos. Therefore,when such a high quality video is stored in an existing storage mediumor transmitted over an existing wired or wireless broadbandcommunication network, transmission and storage costs accordinglyincrease. In order to solve this problem with increase in the demand forhigh-resolution and high-quality videos, highly efficient videocompression technologies may be used.

There are various video compression technologies such as aninter-picture prediction technology for predicting values of pixels in acurrent picture from a previous picture or a future picture of a currentpicture, an intra-picture prediction technology for predicting values ofpixels in a region of a current picture from another region of thecurrent picture, and an entropy coding technology for allocating shortercodes to pixels with higher probabilities and longer codes to pixelswith lower probabilities. With these video compression technologies,video data can be effectively compressed, transmitted, and stored.

In addition, the demand for a new video service such as stereoscopicvideo content has increased with an increasing demand forhigh-resolution videos. For this reason, video compression technologiesfor effectively providing high-definition or ultra-high-definitionstereoscopic video content have been under discussion and development.

DETAILED DESCRIPTION OF THE INVENTION Technical Problem

The present invention is intended to improve coding efficiency of aCABAC context model.

The present invention is intended to improve an inter predictioncompression efficiency.

The present invention is intended to improve an intra predictioncompression efficiency.

The present invention is intended to provide a method of scanning anon-square transform block.

The present invention is intended to provide a method of performingadaptive in-loop filtering.

Technical problems to be solved by the present embodiment are notlimited to the above-described ones and there may be other technicalproblems to be solved by the present invention.

Technical Solution

The present invention provides a method and apparatus for adaptivelyinitializing a CABAC context model.

The present invention provides a method and apparatus for refining anencoded/decoded motion vector and performing motion compensation basedon the refined motion vector.

The present invention provides a unidirectional/bidirectional intraprediction method and apparatus for partitioning a current block intomultiple sub-blocks and reconstructing each sub-block one by oneaccording to a predetermined priority.

The present invention provides a method and apparatus for selectivelyusing one scan type from among a plurality of scan types according to agroup of N×M coefficients.

The present invention provides a method and apparatus for applyingin-loop filtering to a boundary between virtual blocks having differentmotion vectors.

Advantageous Effect

According to the present invention, it is possible to improve codingperformance by using a state of a CABAC context model, which is storedin the process of coding a previous picture in terms of theencoding/decoding order or coding a reference picture using the same QPas a current picture, as an initial value of a CABAC context model of acurrent picture.

In addition, according to the present invention, the coding performancecan be improved by referring to the state of the CABAC context modelstored in parallelization units within a reference picture, whichcorrespond to respective parallelization units within the currentpicture.

In addition, according to the present invention, a more accuratelyrepresented video can be reconstructed and coding efficiency isincreased by performing additional refinement on an encoded/decodedmotion vector.

According to the present invention, compression efficiency of intraprediction can be improved by using a unidirectional/bidirectionalprediction technique.

According to the present invention, transform coefficients can beeffectively scanned.

According to the present invention, a subjective or objective videoquality improvement can be obtained by applying in-loop filtering to aboundary between virtual blocks having different motion vectors.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to one embodiment of the present invention;

FIG. 2 is a block diagram illustrating a video decoding apparatusaccording to one embodiment of the present invention;

FIG. 3 is a schematic view illustrating the configuration of a CABACcontext encoding/decoding apparatus for adaptively initializing a CABACcontext model, according to one application example of the presentinvention;

FIG. 4 illustrates a technique of adaptively initializing a CABACcontext model, according to one embodiment of the present invention;

FIG. 5 illustrates a method of adaptively initializing a CABAC contextmodel on a per-parallelization unit basis, according to one applicationexample of the present invention;

FIGS. 6 and 7 illustrate a parallel processing-based CABAC context modelinitialization method according to one application example of thepresent invention;

FIG. 8 illustrates a process of performing inter prediction byselectively refining some motion vectors, according to one applicationexample of the present invention;

FIG. 9 illustrates an example in which a block size is changed in aprocess of refining a motion vector when motion vector refinement isrepeatedly performed, according to the embodiment of FIG. 8;

FIG. 10 illustrates the sizes and shapes of blocks resulting frompartitioning which is performed to support repeated motion vectorrefinements, according to one application example of the presentinvention;

FIG. 11 is illustrates a process of performing inter prediction byselectively signaling a motion vector difference, according to oneapplication example of the present invention;

FIG. 12 illustrates a unidirectional intra prediction method performedon a per sub-block basis according to one application example of thepresent invention;

FIG. 13 illustrates a bidirectional intra prediction method performed ona per sub-block basis according to one application example of thepresent invention;

FIG. 14 is illustrates a method of scanning a square transform block,according to one application example of the present invention;

FIGS. 15 and 16 illustrate a method of scanning a non-square transformblock, according to one application example of the present invention;

FIG. 17 illustrates an application range of in-loop filtering accordingto one application example of the present invention;

FIG. 18 illustrates a method of determining an application range ofin-loop filtering according to one application example of the presentinvention; and

FIG. 19 illustrates a method of applying in-loop filtering to a boundaryof a geometrical shape according one application example of the presentinvention.

BEST MODE OF INVENTION

An inter prediction method according to the present invention includesobtaining motion vector refinement information on a current block,reconstructing a motion vector of the current block, performing primarymotion compensation on the current block on the basis of the motionvector, refining the motion vector of the current block using the outputof the motion compensation performed on the current block or using atleast one piece of the motion vector refinement information, andperforming secondary motion compensation on the current block using therefined motion vector.

An intra prediction method according to the present invention includesreconstructing a first sub-block within a current block by performingintra prediction on the first sub-block within the current block on thebasis of a reference pixel of the current block and performs an intraprediction on a second sub-block within the current block using at leastone of the reference pixel of the current block or a pixel within thereconstructed first sub-block.

A transform coefficient scanning method according to the presentinvention includes decoding a scanned bit-stream, obtaining transformcoefficients of a transform block, and scanning the transformcoefficients of the transform block according to a predetermined scantype, in which the scanning may be performed in a per-group basis(wherein the group consists of N×M coefficients) and the scan type maybe selected based on a signaled index from among a plurality of scantype candidates.

A video decoding apparatus according to the present invention includesan entropy decoding unit for obtaining motion vector refinementinformation on a current block and an inter prediction unit forreconstructing a motion vector of the current block, performing primarymotion compensation on the current block on the basis of the motionvector, refining the motion vector of the current block using the outputof the motion compensation performed on the current block or by using atleast one piece of the motion vector refinement information, andperforming secondary motion compensation on the current block using therefined motion vector.

A video decoding apparatus according to the present invention mayinclude an intra prediction unit for performing intra prediction on afirst sub-block within a current block on the basis of a reference pixelof the current block, reconstructing the first sub-block, and performingintra prediction on a second sub-block within the current block using atleast either one or both of the reference pixel of the current block anda pixel within the reconstructed first sub-block.

A video decoding apparatus according to the present invention mayinclude an entropy decoding unit for decoding a scanned bit-stream andobtaining transform coefficients of a transform block and a realignmentunit for scanning the transform coefficients of the transform blockaccording to a predetermined scan type, in which the scanning may beperformed in a per-group basis (wherein the group consists of N×Mcoefficients) and the scan type may be selected based on a signaledindex from among a plurality of scan type candidates.

MODE FOR INVENTION

The present invention may be embodied in many forms and have variousembodiments. Thus, specific embodiments will be illustrated in thedrawings and will be described in detail below. While specificembodiments of the invention will be described herein below, they areonly illustrative purposes and should not be construed as limiting tothe invention. Thus, the invention should be construed to cover not onlythe specific embodiments but also cover other embodiments andmodifications and equivalents to the specific embodiments and otherpossible embodiments. Throughout the drawings, like reference numbersrefer to like elements.

Terms used in the specification, “first”, “second”, etc. may be used todescribe various components, but the components are not to be construedas being limited to the terms. That is, the terms are used todistinguish one component from another component. Therefore, the firstcomponent may be referred to as the second component, and the secondcomponent may be referred to as the first component. Moreover, the term“and/or” includes any and all combinations of one or more of theassociated listed items or includes one or more of the associated listeditems.

It is to be understood that when any element is referred to as being“connected to” or “coupled to” another element, it may be connecteddirectly to or coupled directly to another element or be connected to orcoupled to another element, having the other element interveningtherebetween. On the other hand, when an element is referred to as being“directly connected” or “directly coupled” to another element, it shouldbe understood that there are no other elements in between.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to limit the invention. As usedherein, the singular forms “a”, “an” and “the” are intended to includethe plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” or “includes” and/or “including,” when used in thisspecification, specify the presence of stated features, regions,integers, steps, operations, elements and/or components, but do notpreclude the presence or addition of one or more other features,regions, integers, steps, operations, elements, components and/or groupsthereof.

Hereinafter, preferred embodiments of the present embodiment will bedescribed in detail with reference to the accompanying drawings. Likeelements are denoted by like reference numerals throughout the drawings,and a description of like elements may not be duplicated herein below.

FIG. 1 is a block diagram of a video encoding apparatus according to oneembodiment of the present invention.

Referring to FIG. 1, a video encoding apparatus 100 includes a picturepartitioning unit 110, a prediction unit 120+125, a transformation unit130, a quantization unit 135, a realignment unit 160, an entropyencoding unit 165, a dequantization unit 140, an inverse-transformationunit 145, a filter unit 150, and a memory 155.

Components of the video encoding apparatus illustrated in FIG. 1 areindependently shown only in order to indicate that they performdifferent characteristic functions. Therefore, the components that areindependently shown do not mean that each of the components may not beimplemented as one piece of hardware or software. That is, although thecomponents are illustrated in divided forms for convenience ofexplanation, a plurality of components may be combined with each otherto thereby be operated as one component, or one component may be furtherdivided into a plurality components to thereby be operated as theplurality of components. All of these forms are included in the scope ofthe present invention as long as they do not depart from essentialcharacteristics of the present invention.

In addition, some of the components may not be indispensable componentsperforming essential functions of the present invention but be selectivecomponents improving only performance thereof. The present invention mayalso be implemented only by a structure including the indispensablecomponents except for the selective components, and the structureincluding only the indispensable components is also included in thescope of the present invention.

The picture partitioning unit 110 may partition an input picture intoone or more blocks. In this case, the block may mean a coding unit (CU),a prediction unit (PU), or a transform unit (TU). The partitioning maybe performed based on at least one of a quadtree or a binary tree. Thequad tree is a partitioning scheme of partitioning one block intoquadrants (i.e., four sub-blocks) which are in half in both of the widthand the height of the original block. The binary tree is a partitioningscheme of partitioning one block into halves (i.e., two sub-blocks)which are in half in either the height or the width of the originalblock. In a binary tree structure, when a block is divided in half inthe height, a sub-block may have a square shape or a non-square shape,depending on the shape of the original block.

In embodiments of the present invention described herein below, a codingunit may be regarded not only as a basic unit for processing in anencoding process but also a basic unit for processing in a decodingprocess.

The prediction unit 120+125 may include an inter prediction unit 120 forperforming inter prediction and an intra prediction unit 125 forperforming intra prediction. For each of the prediction units, aprediction method is first determined. That is, whether to use interprediction or intra prediction is determined first. Next, concreteinformation (e.g., a prediction mode for intra prediction, a motionvector, a reference picture, etc.) for the determined prediction methodmay be determined. Here, it should be noted that a basic unit forperforming a prediction process, and a basic unit for determining aprediction method and concrete information for prediction are may differfrom each other. That is, a prediction method, a prediction mode, etc.may be determined on a per-PU basis but prediction may be performed on aper-TU basis. A residual value (residual block), which is a differencebetween an original block and a generated prediction block, may be fedinto the transformation unit 130. In addition, prediction modeinformation which is information on a prediction mode used for theprediction and motion vector information which is information on amotion vector used for the prediction may be encoded together with theresidual value by the entropy encoding unit 165, and then transmitted toa decoder. When a specific encoding mode is used, the prediction unit120+125 may not generate a prediction block but an original block may beencoded as it is and then the resulting signal may be transmitted to thedecoder.

The inter prediction unit 120 may generate a prediction unit on thebasis of information on at least one of a previous picture and asubsequent picture to a current picture. In some cases, the interprediction unit 120 may generate a prediction unit on the basis ofinformation on a portion of an encoded region within the currentpicture. The inter prediction unit 120 may include a reference pictureinterpolation unit, a motion prediction unit, and a motion compensationunit.

The reference picture interpolation unit may receive information on areference picture from the memory 155 and generate pixel information ofinteger pixels or sub-pixels within the reference picture. For lumapixels, a DCT-based eight-tap interpolation filter having differentfilter coefficients may be used to generate pixel information on integerpixels and sub-pixels on a per-¼-pixel basis. For chroma pixels, aDCT-based fourth-tap interpolation filter having different filtercoefficients may be used to generate pixel information on integer pixelsor sub-pixels on a per-⅛-pixel basis.

The motion prediction unit may perform motion prediction on the basis ofthe interpolated reference picture resulting from interpolationperformed by the reference picture interpolation unit. Various motionvector calculation methods such as a full search-based block matchingalgorithm (FBMA), three step search (TSS), and new tree-step searchalgorithm (NTS) can be used. A motion vector may have a motion vectorvalue for a half-pixel or a quarter-pixel by performing the pixelinterpolation. The motion prediction unit may predict a currentprediction unit (PU) while changing motion prediction methods. Variousmotion prediction methods, such as a skip method, a merge method, and anadvanced motion vector prediction (AMVP) method, can be used.

The intra prediction unit 125 may generate a prediction unit (PU) on thebasis of information on reference pixels around the current block, i.e.,information on pixels within the current picture. In the case where aneighboring block of the current prediction unit is an inter-predictedblock and accordingly reference pixels are inter-predicted pixels,reference pixels within the inter-predicted block may be substituted byreference pixels within a neighboring intra-predicted block. That is,when one reference pixel is unavailable, information on at least oneavailable reference pixel may be used to substitute for the unavailablereference pixel.

In the case of intra prediction, there are angular prediction modes inwhich reference pixels are determined according to a predictiondirection and non-angular prediction modes in which directioninformation is not used in performing prediction. A mode for predictingluma information and a mode for predicting chroma information maydiffer. In order to predict chroma information, intra prediction modeinformation used for predicting luma information or predicted lumasignal information may be used.

In the intra prediction method, reference pixels may fed into anadaptive intra smoothing filter and then a prediction block may begenerated based on the filtered information, depending on a usedprediction mode. Different types of AIS filters may be used forfiltering reference pixels. In order to perform the intra predictionmethod, an intra prediction mode for a current PU may be predicted fromintra prediction modes of neighboring PUs existing around the currentPU. In the case of predicting a prediction mode of the current PU on thebasis of mode information predicted from a neighboring PU, when an intraprediction mode of the current PU is identical to that of the neighborPU, information indicating the fact that the prediction mode of thecurrent PU and the prediction mode of the neighboring PU are identicalmay be signaled using a predetermined flag. On the other hand, when theprediction modes of the current PU and the neighboring PU are differentfrom each other, prediction mode information on the current block may beencoded through entropy encoding.

In addition, a residual block consisting of residual value informationwhich is a difference value between a prediction unit (PU) produced bythe prediction unit 120+125 and the original block of the predictionunit may be generated. The generated residual block may be fed into thetransformation unit 130.

The transformation unit 130 may transform the residual block includingresidual data using a transform method such as DCT or DST. Determinationof the transform method may be performed based on the intra predictionmode of the prediction unit used for generating the residual block.

The quantization unit 135 may quantize values in frequency domain whichare produced by the transformation unit 130. Quantization coefficientsmay vary from block to block or may vary depending on importance of avideo. The calculated value generated by the quantization unit 135 maybe fed into the dequantization unit 140 and the realignment unit 160.

The realignment unit 160 may realign coefficients values with respect tothe quantized residual values.

The realignment unit 160 may transform a two-dimension block form ofcoefficients into a one-dimensional vector form of coefficients using acoefficient scanning method. For example, the realignment unit 160 scanscoefficients from a DC coefficient to a high frequency domaincoefficient using a predetermined scan type and obtains one-dimensionalvector form of coefficients.

The entropy encoding unit 165 performs entropy encoding based on valuesproduced by the realignment unit 160. For the entropy encoding, variousmethods such as exponential Golomb, context-adaptive variable lengthcoding (CAVLC), or context-adaptive binary arithmetic coding (CABAC) canbe used.

The entropy encoding unit 165 may receive various kinds of information,from the realignment unit 160 and the prediction unit 120+125, such asresidual value coefficient information and block type information on aper coding unit (CU) basis, prediction mode information, partitioningunit information, prediction unit information, transmission unitinformation, motion vector information, reference frame information,interpolation information for a block, and filtering information, andthen may encode the received information.

The entropy encoding unit 165 may entropy-encode coefficient valueswhich are input on a per-CU basis from the realignment unit 160.

The dequantization unit 140 and the inverse-transformation unit 145 maydequantize and inverse-transform the values quantized and transformed bythe quantization unit 135 and the transformation unit 140. The residualvalue generated through the processes performed in the dequantizationunit 140 and the inverse-transform unit 145 will be added to theprediction unit produced through processes performed in the motionestimation unit, the motion compensation unit, and the intra predictionunit included in the prediction unit 120+125 to generate a reconstructedblock.

The filter unit 150 may include at least one of a deblocking filter, anoffset correction unit, and an adaptive loop filter (ALF).

The deblocking filter can eliminate a block distortion attributable to aboundary between blocks from a reconstructed picture. In order todetermine whether it is necessary to perform deblocking, a determinationof whether to apply deblocking to the current block may be performedbased on pixels included in several rows or columns included in a block.When it is determined that it is necessary to apply deblocking to ablock, a strong filter or a weak filter may be selectively usedaccording to the intensity of the deblocking. At the time of performingthe deblocking, when both of vertical filtering and horizontal filteringare used, the vertical filtering and the horizontal filtering may beperformed in parallel.

The offset correction unit can refine an offset between the deblockedvideo and the original video on a per-pixel basis. In order to performoffset correction for a certain picture, various offset correctionmethods can be used: a method of dividing pixels included in a videointo a predetermined number of regions, determining a region to undergothe offset correction, and performing offset correction on thedetermined region; and a method of performing offset correction whiletaking edge information of each pixel into account.

The ALF may be performed based on a value resulting from comparisonbetween a filtered video and a reconstructed video. Pixels in a videomay be divided into a predetermined number of groups, a filter to beused for a certain group is determined, and each group may be filteredusing respectively different filters. Information indicating whether toapply ALF may be signaled on a per CU basis for luma signals, and theshape and coefficient of a filter for ALF may vary from block to block.Alternatively, filters for ALF for each block may be identical (fixed)in shape, regardless of characteristics of target blocks to undergo ALF.

The memory 155 may store reconstructed blocks or pictures output fromthe filter unit 150, and the stored reconstructed blocks or pictures maybe fed into the prediction unit 120+125 for the subsequent interprediction.

FIG. 2 is a block diagram illustrating a video decoding apparatusaccording to one embodiment of the present invention.

Referring to FIG. 2, a video decoder 200 includes an entropy decodingunit 210, a realignment unit 215, a dequantization unit 220, aninverse-transformation unit 225, a prediction unit 230+235, a filterunit 240, and a memory 245.

When a video bit-stream is fed into the video decoder 200 from the videoencoder, the bit-stream may be decoded in the reverse sequence to theprocess sequence performed in the video encoder.

The entropy decoding unit may perform entropy decoding in reversesequence to the sequence of entropy encoding performed in the entropyencoding unit. For example, various methods such as exponential Golomb,context-adaptive variable length coding (CAVLC), or context-adaptivebinary arithmetic coding (CABAC) can be used so as to correspond to themethod used in the video encoder.

The entropy decoding unit 210 may decode information associated withintra prediction and inter prediction performed in the encoder.

The realignment unit 215 may realign the bit-stream that is decoded bythe entropy decoding unit 210 using a method, which is used by theentropy encoding unit to perform entropy encoding to produce thebit-stream. The coefficients represented in one-dimensional vector formmay be rearranged into coefficients in a two-dimensional block form. Therealignment unit 215 may receive information on coefficient scanningperformed in the encoding unit and perform realignment in reversesequence to the scanning sequence performed in the encoding unit.

The dequantization unit 220 may perform dequantization on the basis ofcoding parameters provided by the encoder and coefficient values ofrealigned blocks.

The inverse-transformation unit 225 may inverse-transform thedequantized transform coefficients using a predetermined transformmethod. In this case, a transform method may be determined based oninformation on a prediction method (inter/intra prediction), asize/shape of a block, and an intra prediction mode.

The prediction unit 230/235 may generate a prediction block on the basisof information on generation of a prediction block, which is provided bythe entropy decoding unit 210, and information on a previously decodedblock or picture, which is received from the memory 245.

The prediction unit 230+235 may include a PU determination unit, aninter prediction unit, and an intra prediction unit. The PUdetermination unit receives various kinds of information such asprediction unit information, prediction mode information used in theintra prediction method, motion compensation information used in theinter prediction method, which are provided by the entropy decoding unit210, identifies a prediction unit for a current block, and determineswhether the prediction unit is an inter-predicted prediction unit or anintra-predicted prediction unit. The inter prediction unit 230 may useinformation required for inter prediction for a current prediction unit,which is provided by the video encoder and information included in atleast one of a previous picture and a subsequent picture of a currentpicture within which the current prediction unit is included, to performinter prediction on the current prediction unit. Alternatively, theinter prediction may be performed based on information on a portion of apreviously reconstructed region within the current picture in which thecurrent prediction unit is included.

In order to perform inter prediction, for each coding unit, a predictionmethod for a prediction unit included within the coding unit may bedetermined. That is, which mode among a skip mode, a merge mode, and anAMVP mode is used for producing a prediction mode may be determined.

The intra prediction unit 235 may generate a prediction unit (PU) on thebasis of information on pixels within a current picture. When theprediction unit is a prediction unit generated through intra predictionduring encoding, intra prediction may be performed based on intraprediction mode information on the prediction unit, which is provided bythe video encoder. The intra prediction unit 235 may include an adaptiveintra smoothing filter, a reference picture interpolation unit, and a DCfilter. The AIS filter is a unit for performing filtering on referencepixels of the current block and may perform or may not performfiltering, depending on the prediction mode of the current predictionunit. By using the AIS filter information and the prediction mode of theprediction unit provided by the video encoder, AIS filtering may beperformed on the reference pixels in the current block. When theprediction mode of the current block is a mode that does not require AISfiltering, the AIS filtering may not be applied.

When the prediction mode of the prediction unit is a prediction unitgenerated through intra prediction which is performed by pixel valuesobtained by interpolating reference pixels, the reference pixelinterpolation unit may generate a reference pixel value on a persub-pixel basis by interpolating reference pixels. Reference pixels maynot be interpolated when the prediction mode of the current predictionunit is a prediction mode in which a prediction block can be generatedwithout interpolating reference pixels. The DC filter may generate aprediction block by performing filtering when the prediction mode is DCmode.

The reconstructed block or picture may be fed into the filter unit 240.The filter unit 240 may include a deblocking filter, an offsetcorrection unit, and an adaptive loop filter (ALF).

Information may be received from the video decoder: information onwhether deblocking filtering is applied to a target block or picture;and information on which filter is used between a strong filter or aweak filter when the deblocking filtering is applied. The deblockingfilter of the video decoder may receive deblocking information from thevideo encoder and perform deblocking filtering on the target block.

The offset correction unit may perform offset correction on thereconstructed video on the basis of information of an offset type and anoffset value which have been applied to a video during encoding.

The ALF may apply filtering to a coding unit on the basis of informationindicating whether ALF is applied, information of an ALF coefficient,etc. which are provided by the encoder. The ALF information may beinserted into a specific parameter so as to be signaled.

The memory 245 stores reconstructed pictures or blocks so that thereconstructed pictures or blocks can be used as reference pictures orblocks, or feeds them to an output unit.

Herein below, a CABAC encoding method and apparatus and a CABAC decodingmethod and apparatus according to embodiments of the present inventionwill be described with reference to FIGS. 3 to 7. In various embodimentsdescribed in herein, the term “parallelization unit” refers to a set ofone or more coding units constituting one picture, which is created forparallel processing during video encoding and decoding. Here, the term“coding unit” collectively refers to a coding unit which can bepartitioned into sub-coding units based on a tree structure and a codingunit which cannot be further partitioned.

FIG. 3 is a schematic view illustrating the configuration of a CABACencoding/decoding apparatus for adaptively initializing a CABAC contextmodel, according to one embodiment to which the present invention isapplied.

Referring to FIG. 3, the CABAC encoding/decoding apparatus according toone embodiment of the present invention may include a contextinitialization determination unit 310, a reference context loading unit320, and a context initial value loading unit 330 or a contextinitialization unit 340.

The context initialization determination unit 310 may determine whetheradaptively initializing a CABAC context model is to be performed, basedon information indicating whether adaptive initialization of a CABACcontext model has been performed. The information indicating the resultof the determination of whether the adaptive initialization of a CABACcontext model is to be performed may be encoded into a flag form or thelike in the video encoding apparatus. The information may include aspecific value indicating the state of a reference CABAC context. Theinformation may be inserted into a high-level syntax of a bit-stream soas to be signaled to the video decoding apparatus. For example, theinformation may be inserted into at least one of a sequence parameterset and a picture parameter set so as to be signaled. The informationmay be signaled on a per parallelization unit basis which constitutes apicture. In this way, an independent adaptive initialization of a CABACcontext model per parallelization unit may be allowed.

Responding to the information indicating that the CABAC context isadaptively initialized, the reference context loading unit 320 mayacquire a reference CABAC context state. The context initialization unit340 may initialize a CABAC context model on the basis of the acquiredreference CABAC context state.

The reference CABAC context state may mean a CABAC context state storedin the previous decoding process. The reference CABAC context state maymean a CABAC context state stored at a specific position within apreviously-decoded picture. For example, the reference CABAC contextstate may be a CABAC context state stored at a specific position withina picture identical to the picture to which the current CABAC contextmodel belongs or within a reference picture at a different point intime. Here, the specific position may mean a position within aparallelization unit which corresponds to the current CABAC contextmodel or within a temporally or spatially adjacent parallelization unit.The specific position may be a fixed position preliminarily agreedbetween the CABAC encoding apparatus and the CABAC decoding apparatus.The specific position may be identified based on information signaledusing a bit-stream. The signaled information may mean informationindicating the specific position, which is coded by the CABACinformation, information on a reference of the current picture,information on attributes (for example, a partitioning technique, size,shape, depth, etc.) of a block constituting a picture, etc.

When a picture is partitioned into parallelization units (for example,tiles), the reference CABAC context state may mean a CABAC context stagestored at a specific position in a corresponding parallelization unitwithin a previously decoded picture. The corresponding parallelizationunit may be a co-located parallelization unit within a reference pictureor a parallelization unit using the same quantization parameter (QP)within a reference picture.

In the case where a picture is partitioned into parallelization units,when the size and/or the number of parallelization units in each of thepictures is the same, the reference CABAC context state may mean aspecific position in a co-located parallelization unit in a previouslydecoded picture.

On the other hand, when the size and/or the number of parallelizationunits is not same, any one CABAC context state among CABAC contextstates stored in a previously decoded picture may be selected. Theselection may be performed taking into account a difference between theposition of the stored CABAC context state and the position of theparallelization unit. For example, a CABAC context state having thesmallest difference with the parallelization unit in terms of positionmay be selected as the reference CABAC context state. In a case wherethe size and/or the number of parallelization units is not same, a CABACcontext state stored in a parallelization unit occupying the largestarea within a previously decoded picture may be used as the referenceCABAC context state when position information on CABAC context stateswithin the previously decoded picture is mapped on parallelizationunits.

In the case where a plurality of sub-pictures exists within a picturelike a 360-degree video, a CABAC context state stored at a specificposition within each sub-picture existing within a picture may be usedas a reference CABAC context state.

FIG. 4 illustrates a technique of adaptively initializing a CABACcontext model, according to one embodiment of the present invention.

In FIG. 4, a reference picture 410 may be an encoded/decoded picture(i.e., previously encoded/decoded picture) preceding to a currentpicture 420 and may mean a picture referred to for initialization of aCABAC context model of the current picture 420. The reference picture410 may be any one of a plurality of reference pictures which isreferred to by the current picture 420 when inter prediction for thecurrent picture 420 is performed. For example, the reference picture 410may be a reference picture with a predetermined index, which is includedin a reference picture list for the current picture. The predeterminedindex may be a fixed value preset in the CABAC encoding apparatus andthe CABAC decoding apparatus. The predetermined index may be a variablevalue signaled using a bit-stream or derived from a reference pictureindex of a block included within the current picture 420. A picturehaving the same quantization parameter (QP) as the current picture 420may be selected and used as the reference picture 410.

As illustrated in FIG. 4, the current picture 420 may refer to a CABACcontext state stored at a specific position within the reference picture410 for adaptive initialization of the CABAC context model.

The specific position within the reference picture 410 may mean aposition of a coding unit, which is preliminarily agreed between theCABAC encoding apparatus and the CABAC decoding apparatus, andinformation indicating the specific position may not be signaled. TheCABAC encoding apparatus may determine the optimum specific positionwithin the reference picture 410 while taking coding efficiency intoaccount, encode the determined optimum specific position, and signal theencoded information to the CABAC decoding apparatus.

The process of referring to the CABAC context state stored at thespecific position within the reference picture 410 may include a processof loading a CABAC context state stored at the time of encoding/decodinga block corresponding to the specific position within the referencepicture 410.

The process of initializing the CABAC context model of the currentpicture 420 means initializing the CABAC context state of the startblock of the current picture 420, based on the loaded CABAC contextstate.

FIG. 5 illustrates a method of adaptively initializing a CABAC contextmodel on a per parallelization unit basis, according to one embodimentto which the present invention is applied.

In the present embodiment, for convenience of description, a case wherethe parallelization unit is a tile will be described as an example. Areference picture illustrated in FIG. 5 has been described in detailwith reference to FIG. 4. Therefore, a description thereof will not beduplicated here. As illustrated in FIG. 5, the reference picture 510 iscomposed of four parallelization units 511, 512, 513, and 514, and acurrent picture 520 is composed of the same number and size ofparallelization units 521, 522, and 523, and 524.

As illustrated in FIG. 5, the parallelization units of the currentpicture 520 may refer to CABAC context states stored at specificpositions in the parallelization units of the reference picture 510 foradaptive initialization of the CABAC context model. In this case, theparallelization unit of the current picture 520 may refer to aparallelization unit located at the same position within the referencepicture 510, or may refer to a parallelization unit located at adifferent position within the reference picture. The parallelizationunit at the different position may be a parallelization unit in thereference picture 510, which uses the same quantization parameter (QP)as the parallelization unit in the current picture 520.

The specific position in the parallelization unit may mean a position ofa coding unit preset in the CABAC encoding apparatus and the CABACdecoding apparatus, and, in this case, information indicating thespecific position may not be signaled. The CABAC encoding apparatus maydetermine the optimum specific position within each parallelization unitwhile taking coding efficiency into account, encode the determinedoptimum specific position, and signal the encoded information to theCABAC decoding apparatus.

The process of referring to the CABAC context state stored at thespecific position within the reference picture 510 may include a processof loading a CABAC context state stored at the time of encoding/decodinga block corresponding to the specific position in the parallelizationunit within the reference picture 510.

The process of initializing the CABAC context model of eachparallelization unit of the current picture 520 means initializing theCABAC context state of the start block of each of the parallelizationunits which belong to the current picture 520, based on the loaded CABACcontext state.

FIGS. 6 and 7 illustrate a parallel processing-based CABAC context modelinitialization method according to one embodiment to which the presentinvention is applied.

Referring to FIG. 6, the parallel processing-based CABAC context modelinitialization method according to the present embodiment initializes aCABAC context model for each of the block lines 610, 620, 630, 640, and650, and may initialize a CABAC context model of a first block of oneblock line of the block lines by referring to the CABAC context state ofa second block of a previous block line. Here, a block may mean a codingunit, and may specifically denote a coding tree block (CTB), a codingblock generated through tree structure partitioning, or a smallestcoding block (SCU).

Referring to FIG. 7, a current picture 720 refers to a CABAC contextstate stored at a specific position in a reference picture 710 andinitializes a CABAC context model for a first block line 721 of thecurrent picture 720. Initialization of CABAC context models of the otherblock lines than the first block line of the current picture 720 may beperformed by referring to a previous block line as having been describedwith reference to FIG. 6. In some cases, initialization of a CABACcontext model of at least one of the other block lines 722, 723, 724,and 725 may be performed by referring to the CABAC context state storedat the specific position in the reference picture 710. Here, thespecific position (hereinafter, referred to as a first specificposition) in the reference picture 710 referred to by a block line 821may be the same as or may be different from the specific position(hereinafter, referred to as a second specific position) in thereference picture 710 referred to by at least one of the other blocklines.

The specific position may be variable positions determined according tothe position of each of the block lines included in the current picture720 or fixed positions allocated to the respective block lines.

The specific position may be a fixed position preset in the CABACencoding apparatus and the CABAC decoding apparatus. The specificposition may be identified based on information signaled using abit-stream. The signaled information may include information indicatingthe specific position, which is encoded by the CABAC information,information on a reference of the current picture, information onattributes (for example, a partitioning technique, size, shape, depth,etc.) of a block constituting a picture, etc.

Herein below, a method of performing inter prediction based on motionvector refinement, which is performed by the inter prediction unit, willbe described with reference to FIG. 11.

The inter prediction unit may determine a motion vector of a currentblock on the basis of a predetermined inter mode (for example, a skipmode, a merge mode, and an AMVP mode), and perform inter predictionusing the determined motion vector. The determined motion vector may beused as it is or may be used after being refined based on motion vectorrefinement information.

Here, the motion vector refinement information may include at least oneof refinement ON/OFF information, refinement repeat/non-repeatinformation, the number of times that the refinement is repeated,information on a resolution of a motion vector, information on anallowable refinement range, motion vector refinement signalinginformation, and information on a block, slice, and picture which isreferred to for refinement of a motion vector.

The motion vector may be selectively refined based on the refinementON/OFF information. The refinement ON/OFF information may be informationindicating whether a motion vector is to be refined or not and may berepresented in the form of a flag. The motion vector may be refined at aresolution indicated by the information on the resolution of a motionvector. Possible resolution candidates may include integer pels andsub-pels such as a ½ pel, a ¼ pel, a ⅛ pel, and a 1/16 pel, and themotion vector resolution information may specify at least one of thepossible resolution candidates. The information on an allowablerefinement range may mean a resolution range within which refinement isallowed, a block range on which motion vector refinement is performed,etc.

The motion vector refinement information may be signaled using abit-stream, and at least one piece of the motion vector refinementinformation may be derived from spatially neighboring blocks (forexample, a left neighboring block, an upper neighboring block, a topleft neighboring block, a bottom left neighboring block, a top rightneighboring block, etc.) and/or temporally neighboring blocks. Inaddition, at least one piece of the motion vector refinement informationmay be fixed information preset in the video encoding apparatus and thevideo decoding apparatus or variable information determined according toattributes of the current block (for example, an inter prediction type,whether to perform bidirectional prediction, whether to use anear-distance reference picture, the size/shape/depth of a block, apartitioning technique, whether a residual coefficient exists or not, aquantization parameter, etc.). The motion vector refinement informationmay be signaled or derived at any level among various levels including asequence level, a picture level, a slice level, a tile level, a blocklevel (for example, a coding block level, a prediction block level,etc.) according settings preset in the video encoding apparatus and thevideo decoding apparatus or according to the characteristics ofinformation. In some cases, at least one piece of the motion vectorrefinement information may not be signaled according to settings presetin the video encoding apparatus and the video decoding apparatus. Forexample, when the size of the current block satisfies a predeterminedcondition and the bidirectional prediction is performed for the currentblock, the motion vector refinement is performed. The predeterminedcondition means that the vertical or horizontal size of the currentblock is equal to or larger than a predetermined size or the area of thecurrent block is equal to or larger than a predetermined area.

In a case where a prediction block of the current block is generatedusing inter prediction, motion vectors may be stored in the videoencoding/decoding apparatus, and in this case the videoencoding/decoding apparatus may be equipped with a dedicated buffer forstoring the motion vectors.

The motion vector refinement according to the present invention isdescribed for a case where the refinement is applied to a reconstructedmotion vector. However, the present invention is not limited thereto,and it is of course possible to apply the same or similar refinementprocess to a predicted motion vector.

FIG. 8 illustrates a process of performing inter prediction byselectively refining some motion vectors, according to one embodiment towhich the present invention is applied.

Referring to FIG. 8, motion vector refinement information on a currentblock may be acquired (S800). Here, the motion vector refinementinformation is the same as described above. That is, the motion vectorrefinement information may include at least one of refinement ON/OFFinformation, information on the number of times that the refinement isrepeated, information on a resolution of a motion vector, information onan allowable refinement range, motion vector refinement signalinginformation, and information on a block, slice, and picture which isreferred to for refinement of a motion vector. That is, at least onepiece of the motion vector refinement information may be acquired.

When the refinement ON/OFF information indicates that a motion vector isto be refined, a motion vector may be refined (S810).

The motion vector refinement may be performed at the same resolution asthe motion vector refinement performed in the video encoding apparatus,or at a different resolution from the motion vector refinement performedin the video encoding apparatus. That is, a higher resolution or a lowerresolution than that used in the video encoding apparatus can be used.For example, the video encoding apparatus may encode and signal a motionvector on a per integer-pel basis and the video decoding apparatus mayrefine the motion vector on a per sub-pel basis (for example, on a per½-pel, ¼-pel, ⅛-pel, 1/16-pel basis). Information on refinement on afiner sub-pixel basis may be included within the motion vectorrefinement information.

The motion vector may be refined using a previously decodedpredicted/reconstructed value. The previously decodedpredicted/reconstructed value may be a predicted/reconstructed value ofthe current block, which is obtained by performing inter prediction onthe basis of the motion vector of the current block which is arefinement target, or a predicted/reconstructed value of a referencepicture referred to by the current block. The previously decodedpredicted/reconstructed value may be a predicted/reconstructed value ofa neighboring block temporally and/or spatially adjacent to the currentblock.

The motion vector refinement according to the present invention mayinclude a process of calculating an offset vector used to compensate foran error of the motion vector by using the previously decodedpredicted/reconstructed value. In this case, the refined motion vectormay be derived based on a pre-refined motion vector (original motionvector) and a calculated offset vector. For example, the previouslydecoded predicted/reconstructed value is obtained by using a motionvector to be refined and an offset vector candidate of the currentblock. More specifically, the previously decoded predicted/reconstructedvalue is obtained by using a vector derived by summing the motion vector(refinement target) and the offset vector candidate. That is, therefined motion vector is derived by summing the offset vector and themotion vector before refinement. The offset of the offset vector is avalue pre-defined in the image encoding/decoding apparatus or is a valuethat is signaled.

Next, inter prediction is performed again based on the refined motionvector to acquire a predicted/reconstructed value of the current block(S820).

As described above, the refined motion vector or the motion vectorbefore the refinement may be stored in the buffer provided in the videoencoding/decoding apparatus and then may be used to determine a motionvector of a neighboring block and/or a picture which is to besubsequently encoded/decoded. For example, the refined motion vector isused to determine a motion vector of a picture to be subsequentlyencoded/decoded, and the motion vector before the refinement is used todetermine a motion vector of a neighboring block to be subsequentlyencoded/decoded.

On the other hand, when the refinement ON/OFF information indicates thatthe motion vector is not to be refined, the motion vector is used as itis for inter prediction of the current block without being refined(S830).

The motion vector refinement may be repeated by a predetermined numberof times. The number of times that the motion vector refinement isrepeated may be determined according to the information on the number oftimes that the refinement is performed. The information on the number oftimes that the refinement is performed may be signaled using abit-stream. However, in a case where the video encoding apparatus andthe video decoding apparatus have preliminarily agreed on the number oftimes of refinement and thus it is known when to stop the motion vectorrefinement, the information on the number of times of refinement may notbe signaled. When the motion vector refinement is repeatedly performed,only the last motion vector may be stored, and at least one of motionvectors acquired through repeated refinement operations may berepeatedly stored in the buffer of the video encoding/decodingapparatus.

FIG. 9 illustrates an example in which a block is changed in a processof refining a motion vector when motion vector refinement is repeatedlyperformed in the embodiment of FIG. 8.

The motion vector refinement is repeatedly performed for the currentblock having an N×M size (here, N and M may be an equal number ordifferent numbers), the size of the block on which the motion vectorrefinement is performed may be changed to be like a block 400illustrated in FIG. 4, according to the number of times of refinement.

Referring to FIG. 9, the refinement may be performed for a block size ofN/2×M/2 at a first refinement step, performed for a block size ofN/4×M/4 within a top left block 402 at a second refinement step, andperformed for the other blocks 403 having the same size.

Information on whether the motion vector refinement is to be performedfor the same size blocks (the blocks which are not partitioned) using apreviously processed block may also be included in the motion vectorrefinement information.

FIG. 10 illustrates the sizes and shapes of blocks resulting frompartitioning which is performed to support repeated motion vectorrefinements, according to one embodiment to which the present inventionis applied.

As illustrated in FIG. 10(a), a block may be partitioned into sub-blockshaving an equal size according to a partition depth. As illustrated inFIG. 10(b), a block may be partitioned into non-square sub-blocks. Asillustrated in FIG. 10(c), some blocks may be partitioned by a depthdifferent from a partition depth of the other blocks. As illustrated inFIG. 10(d), partitioning may result in asymmetric sub-blocks. Asillustrated in FIGS. 10(e), 10(f), and 10(g), partitioning may result innon-rectangular sub-blocks in which triangular or rectangular sub-blocksmay be mixed. As illustrated in FIG. 10 (h), a block may be partitionedhorizontally by three horizontal lines to produce four non-square blockshaving an equal size. FIGS. 10(a) to 10(h) illustrate some of possibleembodiments of the present invention. That is, a block may bepartitioned into sub-blocks having various sizes and shapes andinformation on the sizes and shapes of the sub-blocks may be included inthe motion vector refinement information.

The smallest unit up to which the partitioning is allowed may be asingle pixel. Blocks which are partially or entirely identical in termsof the motion vector refinement information thereof may be merged. Evenin the case where an original coding unit does not have a rectangularshape, the coding unit may be partitioned into sub-blocks having variousshapes as illustrated in the embodiment of FIG. 10. As illustrated inFIG. 9, one reference picture, two reference pictures, three referencepictures, or a greater number of reference pictures may be used for themotion vector refinement. In the case where the motion vector refinementis repeatedly performed, a reference picture may be changed, andaccordingly a method of acquiring motion vector refinement informationfrom a reference picture may be changed.

When a block is partitioned into sub-blocks having various shapes asillustrated in FIG. 10, the blocks may have different motion vectors. Inthis case, artifacts may occur between blocks having different motionvectors. In order to eliminate the artifacts, in-loop filtering may beapplied which will be described with reference to FIGS. 17 to 19.

FIG. 11 is illustrates a process of performing inter prediction byselectively signaling a motion vector difference, according to oneembodiment to which the present invention is applied.

A motion vector can be modified through motion vector refinement. Whenan offset vector becomes the same as a motion vector difference (MVD)calculated through the process, the decoding of the current block can beperformed without signaling the MVD. That is, when it is determined thatthe motion vector is not modified through the motion vector refinement,signaling of the motion vector difference can be skipped, resulting inimprovement in a coding efficiency.

For selective signaling of the motion vector differences, informationindicating whether signaling of the motion vector difference is skippedmay be used. The information may be signaled using a bit-stream or maybe derived from a specific value determined while taking attributes of ablock into account. For example, when the value of the information is afirst value, the motion vector difference for the current block may notbe signaled. In this case, the motion vector difference may besubstituted by an offset vector calculated through the motion vectorrefinement. On the other hand, when the value of the information is asecond value, the motion vector difference may be signaled using abit-stream.

The information may be signaled at any level of various levels includinga sequence level, a picture level, a slice level, and a block level orsignaling thereof may be skipped depending on conditions that are presetin the video encoding apparatus and the video decoding apparatus. Forexample, in a case where there is an agreement that a motion vectordifference is signaled when a motion vector refinement for a currentblock is not performed, the information may not be signaled.

Referring to FIG. 11, motion vector refinement information may beacquired (S1100). Since the motion vector refinement information is thesame as one that has been described above, a description thereof willnot be duplicated here.

Based on the motion vector refinement information acquired in S1100,whether to refine a motion vector of a current block may be determined(S1110).

When the refinement ON/OFF information indicates that the motion vectorof the current block is not to be refined, motion compensation may beperformed based on a motion vector derived from the sum of a predictedmotion vector and a motion vector difference (S1120).

On the other hand, when the refinement ON/OFF information indicates thatthe motion vector of the current block is to be refined, whether to skipsignaling the motion vector difference of the current block will bedetermined (51130). Whether to skip signaling of the motion vectordifference may be determined using a predetermined flag (for example,mvd_skip_flag).

When it is determined that signaling of the motion vector difference isto be performed, the motion compensation may be performed based on amotion vector derived from the sum of the predicted motion vector andthe motion vector difference (S1140). The motion vector derived in S1140may be refined using a predicted/reconstructed value acquired throughthe motion compensation (S1150). That is, an offset vector forcompensating for an error of the motion vector may be derived using thepredicted/reconstructed value acquired through the motion compensation.A refined motion vector can be acquired by adding the derived offsetvector to the motion vector. Motion compensation may be performed usingthe refined motion vector (S1160).

On the other hand, when it is determined that signaling of the motionvector difference is to be skipped, the motion compensation may beperformed based on a predicted motion vector PMV (S1170). Similarly, thepredicted motion vector acquired in S1170 may be refined using thepredicted/reconstructed value acquired through the motion compensation(S1180). That is, an offset vector for compensating for an error of thepredicted motion vector PMV may be derived using thepredicted/reconstructed value acquired through the motion compensation.A refined motion vector can be acquired by adding the derived offsetvector to the predicted motion vector PMV. Motion compensation may beperformed based on the refined motion vector (S1190).

The motion vector refinement may be repeated by predetermined number oftimes as illustrated in the embodiment of FIG. 11 and described belowwith reference to FIGS. 8 to 10.

Referring to FIGS. 12 to 13, an intra prediction method on a persub-block basis will be described.

FIG. 12 illustrates a unidirectional intra prediction method on a persub-block basis, according to one embodiment to which the presentinvention is applied.

Referring to FIG. 12, a current block may include n sub-blocks. Here,the current block may refer to a coding block or a prediction block. Thecurrent block may mean a block unit to which an intra prediction mode isapplied. Here, n is a natural number, in which n may be a fixed valuepreset in the video encoding apparatus and the video decoding apparatusor a variable value determined according to the attributes of a block.The attribute of a block refers to the result of comparison between thehorizontal and/or vertical size of a block and a predetermined thresholdvalue. Alternatively, the video encoding apparatus may determine theoptimum value of n, encode the value, and signal the encoded value. Thevideo decoding apparatus may determine the value of n on the basis ofthe signaled information.

The sub-block has an N×M size, in which N and M are 1, 2, or a greaternatural number, and N and M may be the same number or different numbers.The sub-block may be composed of one pixel, may be represented pixelgroups having a square or non-square shape, or in pixel lines (rows andcolumns). The size of the sub-block may be a fixed size preset in thevideo encoding apparatus and the video decoding apparatus or a variablesize determined according to the attributes of the block. For example,the size of the sub-block may be fixed including at least 16 samples.The size/shape of the sub-block may be determined, taking into accountdirectionality of an intra prediction mode of the current block. Forexample, when the intra prediction mode has a horizontal directionality,the sub-block may have a rectangular shape where M is greater than N. Onthe other hand, when the intra prediction mode has a verticaldirectionality, the sub-block has a rectangular shape where N is greaterthan M. The video encoding apparatus may encode and signal the optimumsize of the sub-block, and the video decoding apparatus may determinethe size of the sub-block on the basis of the signaled information. Theinformation may be signaled at least one level among a sequence level, apicture level, a slice level, a tile level, and a block level. Forexample, the direction in which the current block is divided into nsub-blocks is signaled at the block level.

In the unidirectional intra prediction method according to the presentinvention, intra prediction and reconstruction of a first sub-block 1210located at a top row in the current block may be performed, based onneighboring pixels adjacent to the current block and intra predictionmodes. A second sub-block 1220 may be intra-predicted and reconstructedusing neighboring pixels and/or pixels in the reconstructed firstsub-block. In this manner, the other sub-blocks 1230 and 1240 can alsobe intra-predicted and reconstructed. In this case, the accuracy of theintra prediction can be improved and energy of a residual error can bereduced. However, the embodiment of FIG. 12 is not intended to limit theprediction and reconstruction order of the sub-blocks. That is,prediction and reconstruction on sub-blocks may be sequentiallyperformed in order of a fourth sub-block, a third sub-block, a secondsub-block and a first sub-block. According to the sizes/shapes ofsub-blocks, the sub-blocks sequentially undergo the prediction andreconstruction in order from a left sub-block to a right sub-block orfrom the right sub-block to the left sub-block. The prediction andreconstruction order may be determined depending on the intra predictionmode of the current block and/or the intra prediction modes ofneighboring blocks. For example, the direction of the intra predictionmode is a direction from top to bottom, the prediction andreconstruction may be performed in order of the first sub-block, thesecond sub-block, the third sub-block, and the fourth sub-block. On theother hand, the direction of the intra prediction mode is a directionfrom bottom to top, the prediction and reconstruction order may beperformed in order of the fourth sub-block, the third sub-block, thesecond sub-block, and the first sub-block. The prediction andreconstruction order may be a fixed order preset in the video encodingapparatus and the video decoding apparatus.

FIG. 13 illustrates a bidirectional intra prediction method on a persub-block basis, according one embodiment to which the present inventionis applied.

Referring to FIG. 13, a predicted value may be acquired by performingintra prediction on a first sub-block 1300 on the basis of referencepixels of the current block, and the current block may be reconstructedby adding a residual value to a predicted value. Here, the firstsub-block 1300 may be a sub-block located at the bottom of the currentblock, a sub-block located at the right end of the current block, or asub-block located at the center of the current block. However, thepresent invention is not limited thereto. The first sub-block 1300 maybe a plurality of sub-blocks constituting the current block. The firstsub-block 1300 may be defined as a predicted and reconstructed block forthe first time among the multiple sub-blocks constituting the currentblock.

Next, a second sub-block 1310 may be predicted for the second time usingat least one of a reference pixel of the current block and a pixel inthe reconstructed first sub-block. That is, like the first sub-block1300, the second sub-block 1310 may be predicted using only a referencepicture of the current block or only a pixel in the reconstructed firstsub-block. The second sub-block 1310 may be predicted and reconstructedusing bidirectional prediction, that is, a first direction predictionand a second direction prediction. Here, the first direction predictionmay mean prediction based on a reference pixel of the current block andthe second direction prediction may mean prediction based on a pixelwithin the reconstructed first sub-block. Depending on the shape of thesub-blocks, the first direction may mean an upward vertical direction,and the second direction may mean a downward vertical direction.Alternatively, the first direction may mean a leftward horizontaldirection and the second direction may mean a rightward horizontaldirection. As illustrated in FIG. 13, the first direction and the seconddirection may be different directions or may be the same direction.

The first direction prediction and the second direction prediction maybe performed using the same intra prediction mode. Alternatively, thefirst direction prediction and the second direction prediction may beperformed using different intra prediction modes. An intra predictionmode (hereinafter, referred to as a second intra prediction mode) usedfor the second direction prediction may be derived on the basis of anintra prediction mode (hereinafter, referred to as a first intraprediction mode) used for the first direction prediction. For example,the second intra prediction mode may be derived by adding or subtractinga predetermined constant to or from the value of the first intraprediction mode. The second intra prediction mode may be derived as amode corresponding to the opposite direction to the first intraprediction mode.

The first direction prediction may be performed based on an encodedintra prediction mode, and the second direction prediction may beperformed based on a default mode. The default mode is an intraprediction mode which is preset in the video encoding apparatus and thevideo decoding apparatus, and may be any one of planar mode, DC mode,and vertical/horizontal mode. The default mode may be determinedaccording to the size/shape of the sub-block. Alternatively, a specificmode may be fixed, regardless of the size/shape of the sub-block.Further alternatively, the default mode can be determined depending onthe direction in which a block is divided.

Multiple sub-blocks of the current block are sequentially predictedand/or reconstructed according to a predetermined patterned predictionorder. To this end, the video encoding apparatus may determine apatterned prediction order, and may signal information on the patternedprediction order. The video decoding apparatus may sequentially predictand/or reconstruct sub-blocks according to a predetermined order byreferring to the signaled information.

Alternatively, the video decoding apparatus may determine the predictionorder of sub-blocks, based on values of neighboring reference pixels, anamount of change in the values of neighboring reference pixels, codinginformation of neighboring blocks, etc. The amount of change may becalculated using multiple reference pixels, and in this case the numberof reference pixels may be two, three, four, or more. The multiplereference pixels may be arranged consecutively or intermittently at apredetermined interval (for example, an interval of one pixel, twopixels, or more pixels).

For example, prediction and/or reconstruction for sub-blocks may beperformed in decreasing order of pixel value differences D of referencepixels. The pixel value difference D with respect to an R2 referencepixel may be calculated according to Equation 1.

D=|R2−R1|+|R2−R3|  [Equation 1]

The pixel value difference D may be calculated for each reference pixelin this way and sub-blocks may be predicted and/or reconstructed inorder of from the maximum difference to the minimum difference.Sub-blocks may be predicted and/or reconstructed sequentially in orderof from a sub-block corresponding to a reference pixel having themaximum difference Dmax to a sub-block corresponding to a referencepixel having the minimum difference Dmin.

The prediction order may be determined to be from left to right, fromright to left, from top to bottom, or from bottom to top, according tothe sizes/shapes of the sub-blocks. The prediction order may bedetermined depending on the intra prediction mode of the current blockand/or the intra prediction modes of neighboring blocks. For example,when the direction of the intra prediction mode is a direction from topto bottom, the prediction and reconstruction may be performed in orderof the first sub-block, the second sub-block, the third sub-block, andthe fourth sub-block. On the other hand, since the direction of theintra prediction mode is a direction from bottom to top, the predictionand reconstruction may be performed in order of the fourth sub-block,the third sub-block, the second sub-block, and the first sub-block. Theprediction and reconstruction order may be a fixed order preset in thevideo encoding apparatus and the video decoding apparatus. For example,in the case of horizontal division as illustrated in FIG. 12, theprediction is performed in the order from the upper end to the lower. Onthe other hand, in the case of vertical division, the prediction isperformed in the order from the right end to the left end.

Herein below, a method of scanning transform coefficients of a transformblock will be described with reference to FIGS. 14 to 16.

In the video encoding apparatus, the transform coefficients of thetransform block may be scanned based on a predetermined scan type. Thetransform block may include one or more coefficient groups. Based on thescanning order determined according to the scan type, transformcoefficients in a coefficient group may be sequentially scanned andcoefficient groups in a transform block may be sequentially scanned.

The coefficient group may have an N×M size. Here, N and M are naturalnumbers, in which N and M may be the same number or different numbers.In the case where N and M are different numbers, N may be greater than Mor less than M. That is, the coefficient group may be a square group ora non-square group. The size/shape of the coefficient group may be afixed size/shape present in the video encoding apparatus or a variablesize/shape determined according to the size/shape of the transformblock. The video encoding apparatus may determine the optimum size/shapeof the coefficient group, taking a coding efficiency into account, andmay encode the determined size/shape. The scan type may be any one of adiagonal scan, a vertical scan, or a horizontal scan. However, the scantype may not be limited thereto. One or more scan types having apredetermined angle may be added to a list of scan type candidates. Thediagonal scan is a scanning method of scanning coefficients from a topright corner to a bottom left corner. The vertical scan is a scanningmethod of scanning coefficients from bottom to top. The horizontal scanis a scanning method of scanning coefficients from right to left. Thescan type may be any one of these.

The scan type may be determined based on at least one of coding blockinformation (for example, a largest/smallest size, a partitioningtechnique, etc), a size/shape of a transform block, a size/shape of acoefficient group, a prediction mode, intra prediction information (forexample, an intra prediction mode value, a directionality, an angle,etc.), and inter prediction information. Alternatively, the videoencoding apparatus may determine the optimum scan type among scan typecandidates that can be used for scanning a transform block and mayencode an index indicating the determined scan type. The scan typecandidates include at least one of a diagonal scan, a vertical scan, ahorizontal scan, a zigzag scan, and a Z scan. The number and kind ofscan types may vary from transform block to transform block and may bedetermined according to at least one of information on a coding block,the size/shape/depth of a transform block, the size/shape of acoefficient group, a prediction mode, information on intra prediction,and information in inter prediction.

When the size of a transform block is greater than a critical value,coefficients within a portion of the transform block may be set to zero.The size of a transform block may be represented in width, height, thesum of width and height, the number of transform coefficients, or anycombination thereof. The predetermined critical value may mean a size(for example, the length of 16 or 32 samples) which is preset in thevideo encoding apparatus. The portion in which transform coefficientsare set to zero may be one or more coefficient rows located at a lowerend of the transform block or one or more coefficient columns located ata right end of the transform block. The portion may be determineddepending on the critical value. For example, a region outside the sizeof the critical value within the transform block is specified, andcoefficients belong to the corresponding region may be set to zero. Forexample, for an N×M transform block, when N is greater than a criticalvalue of 64, transform coefficients located on 64 rows and/or columns atan upper end and/or a left end of the transform block are maintained asthey are, and the other transform coefficients may be set to zero. WhenM is greater than the critical value of 64, transform coefficientslocated on 64 lows and/or columns at an upper end and/or a left end aremaintained as they are, and the other transform coefficients may be setto zero. For example, for an N×M transform block, when N is greater thann, the transform coefficients positioned at columns ranging from thefirst column (leftmost column) to the n-th column are maintained, andthe rest coefficients are set to zero. Alternatively, when M is greaterthan n, the transform coefficients positioned at rows ranging from thefirst row (uppermost row) to the n-th row are maintained, and the restcoefficients are set to zero. When both N and M are greater than n, thetransform coefficients within a n×n block starting from the upper leftcorner are maintained and the rest coefficients are set to zero. Here, nis 16 or 32.

FIG. 14 illustrates a method of scanning a square transform block,according to one embodiment to which the present invention is applied.

Referring to FIG. 14, an 8×8 transform block consists of fourcoefficient groups, and transform coefficients in the 8×8 transformblock may be scanned on a per group basis. FIG. 14(a) illustrates adiagonal scan of a transform block, in which transform coefficients arescanned in order of a bottom right coefficient group, a top rightcoefficient group, a bottom left coefficient group, and a top leftcoefficient group according to a scan order of the diagonal scan type,in which transform coefficients in each group are scanned from a topright end to a bottom left end. FIG. 14(b) illustrates a horizontal scanof a transform block, in which transform coefficients are scanned inorder of a bottom right coefficient group, a bottom left coefficientgroup, a top right coefficient group, and a top left coefficient groupaccording to a scan order of the horizontal scan type, in whichtransform coefficients in each group are scanned from right to left.FIG. 14(c) illustrates a vertical scan of a transform block, in whichtransform coefficients are scanned in order of a bottom rightcoefficient group, a top right coefficient group, a bottom leftcoefficient group, and a top left coefficient group according to a scanorder of the vertical scan type, in which transform coefficients in eachgroup are scanned from bottom to top.

FIGS. 15 and 16 illustrate a method of scanning a non-square transformblock, according to one embodiment to which the present invention isapplied.

FIG. 15 illustrates a method of scanning an 8×4 transform block.

FIG. 15(a) illustrates a case where the scan type is the diagonal scanand scanning is performed on a per group basis, in which one groupincludes 4×4 coefficients. In this case, transform coefficients in atransform block may be scanned from a bottom coefficient group to a topcoefficient group, in which coefficients in each group are scanned froma top right end to a bottom left end according to a diagonal scandirection. FIG. 15(b) illustrates a case where the scan type is thevertical scan and scanning is performed on a per group basis in whichone group includes 4×4 coefficients. In this case, transformcoefficients in the transform block may be scanned from a bottomcoefficient group to a top coefficient group, in which coefficients ineach group are scanned from bottom to top according a vertical scandirection. FIG. 15(c) illustrates a case where the scan type is thehorizontal scan and scanning is performed on a per group basis, in whichone group includes 4×4 coefficients. In this case, transformcoefficients in the transform block may be scanned from a bottomcoefficient group to a top coefficient group, in which coefficients ineach group are scanned from right to left according to a horizontal scandirection. Alternatively, as illustrated in FIG. 15(d), transformcoefficients in a 8×4 transform block may be scanned on a per groupbased in which one group includes 8×4 transform coefficients andscanning is performed from bottom to top according to a verticalscanning direction. For the 8×4 block, scan type candidates may includeat least one of a diagonal scan, a vertical scan, and a horizontal scan,and a coefficient group may be a 4×4 group or an 8×4 group. A method ofdetermining a scan type and a scan group may be the same as describedabove.

FIG. 16 illustrates a scanning method for a 4×8 transform block.

FIG. 16(a) illustrates a case where the scan type is the diagonal scanand scanning is performed on a per group basis, in which the scan groupis a group of 4×4 coefficients. In this case, transform coefficients inthe transform block may be scanned from a left coefficient group to aright coefficient group, in which coefficients in each group are scannedfrom a top right end to a bottom left end according to a diagonal scandirection. FIG. 16(b) illustrates a case where the scan type is thevertical scan and scanning is performed on a per group basis in whichthe scan group is a group of 4×4 coefficients. In this case, transformcoefficients in the transform block may be scanned from a rightcoefficient group to a left coefficient group, in which coefficients ineach group are scanned from bottom to top according a vertical scandirection. FIG. 16(c) illustrates a case where the scan type is thehorizontal scan and scanning is performed on a per group basis, in whichthe scan group is a group of 4×4 coefficients. In this case, transformcoefficients in the transform block may be scanned from a rightcoefficient group to a left coefficient group, in which coefficients ineach group are scanned from right to left according to a horizontal scandirection. Alternatively, as illustrated in FIG. 16(d), transformcoefficients in a 4×8 transform block may be scanned on a per groupbased in which the scan group is a group of 4×8 coefficients andscanning is performed from right to left according to a horizontal scandirection. For the 4×8 block, scan type candidates may include at leastone of a diagonal scan, a vertical scan, and a horizontal scan, and acoefficient group may be a 4×4 group or an 4×8 group. A method ofdetermining a scan type and a scan group may be the same as describedabove.

The video decoding apparatus may acquire transform coefficients in atransform block by entropy-decoding a received bit-stream. The videodecoding apparatus may determine the scan type on the basis of at leastone of coding block information (for example, a largest/smallest size, apartitioning technique, etc.), a size/shape of a transform block, asize/shape of a coefficient group, a prediction mode, intra predictioninformation (for example, an intra prediction mode value, adirectionality, an angle, etc.), and inter prediction information. Whenthe intra prediction mode has a horizontal directionality, the verticalscan may be used. When the intra prediction mode has a verticaldirectionality, the horizontal scan may be used. The video decodingapparatus may specify any one of multiple scan type candidates on thebasis of the energy of the transform coefficients or an index signaledfrom the video encoding apparatus.

Referring to FIGS. 17 to 19, a method of applying in-loop filtering to ablock boundary will be described.

FIG. 17 illustrates ranges to which in-loop filtering is applied,according to embodiments to which the present invention is applied.

Referring to FIG. 17, a dotted line represents a visual block boundary,a bold solid line represents a coding block boundary, and a thin solidline represents a pixel boundary. Here, the virtual block may mean asub-block having an arbitrary size and/or shape within a coding block.In-loop filtering may be symmetrically or asymmetrically applied to avirtual block boundary or a coding block boundary. The in-loop filteringmay be applied to an equal area (range) for every block or to differentranges for respective blocks according to attributes of the blocks. Theshape of the range (hereinafter, referred to as an application range) towhich the in-loop filtering is applied may be one-dimensional band formor a two-dimensional block form. In the present invention, informationon in-loop filtering may be fixed information preset in the videoencoding apparatus and the video decoding apparatus or may be variableinformation signaled using a bit-stream.

In the present embodiment, for convenience of description, it is assumedthat the shape of a filter is one-dimensional and the application rangecovers two pixels on each side of a block boundary (i.e., two pixels onthe left side and two pixels on the right side of a block boundary).

Referring to FIG. 17(a), gray pixels around a boundary 401 are pixels towhich in-loop filtering is applied. When the virtual block has a smallsize as illustrated in FIG. 17(b), the application range around avirtual block boundary 411 and the application range around a virtualblock boundary 412 overlap. On the other hand, when the virtual blockhas a large size as illustrated in FIG. 17(c), there may be an areawhich is covered by neither the application range around a virtual blockboundary 421 nor the application range around a virtual block boundary422. That is, there may be various embodiments according to at least oneof the size of the application range for filtering and the size of thevirtual block.

For example, when the application range for filtering covers threepixels on each side of a boundary (i.e., three pixels on the left sideand three pixels on the right side) in FIGS. 17(a) and 17(b), thereoccurs a region to which filtering is applied multiple times. On theother hand, when the application range of filtering covers one pixel oneach side of a boundary (i.e., one pixel on the left side and one pixelon the right side) in FIGS. 17(a) through 17(c), there is a region towhich filtering is not applied multiple times. In one embodiment, theapplication range for filtering may be zero pixels on each side of theboundary. That is, application of in-loop filtering may be skipped.

FIGS. 17(e), 17(f), and 17(g) illustrate both of a coding block boundaryand a virtual block boundary. Here, dark gray areas represent anapplication range around a coding block boundary to which in-loopfiltering is applied and a bright gray area represents an applicationrange around a virtual block boundary to which in-loop filtering isapplied. As illustrated in FIG. 17(e), the shapes/sizes of in-loopfilters used for a coding block and a virtual block may be identical toeach other. As illustrated in FIG. 17(f), in-loop filtering may beapplied only to coding block boundaries and application of in-loopfiltering to the virtual block boundaries may be skipped. As illustratedin FIG. 17(g), an in-loop filter for a coding block boundary and anin-loop filter for a virtual block boundary may have differentapplication ranges. When the virtual block is a non-square block,filters used respectively for a horizontal boundary and a verticalboundary may differ in at least one of the size, shape, or applicationrange of the filter. For a block to which in-loop filtering is appliedmultiple times, application of in-loop filtering to the entire region orto the overlapped region may be skipped.

FIG. 18 illustrates a method of determining an application range forin-loop filtering according to one embodiment to which the presentinvention is applied.

Referring to FIG. 18, in-loop filtering information can be acquired(S1800).

The in-loop filtering information may include at least one of filterinformation for a boundary of a virtual block and filter information fora boundary of a coding block. One piece of in-loop filtering informationmay be commonly used for filtering a coding block boundary and filteringa virtual bock boundary. The filter information for a virtual blockboundary can be used for filtering a coding block boundary, andconversely the filter information for a coding block boundary can beused for filtering a virtual block boundary. Different pieces of filterinformation may be respectively used for a coding block boundary and avirtual block boundary.

The information may be signaled using a bit-stream, may be derived, ormay be information preset in the video encoding apparatus and the videodecoding apparatus. A part of pieces of the information may be signaledusing a bit-stream, and the remaining pieces of the information may beinformation preset in the video encoding apparatus and the videodecoding apparatus.

Whether a current boundary is a boundary to which in-loop filtering isapplied may be determined (S1810). A method of determining a codingblock boundary and/or a virtual block boundary to which in-loopfiltering is applied may be derived/determined based on informationsignaled using a bit-stream, may be preset in the video decodingapparatus, or may be determined based on the derived information.

When the current boundary is determined to be a boundary to whichin-loop filtering is applied, in-loop filtering may be applied to thecurrent boundary (S1820). Application of the in-loop filtering mayinclude a process of determining the optimum in-loop filter suitable forthe current boundary. The size/shape of an in-loop filter for thecurrent boundary may be determined based on at least one of aquantization parameter, values of pixels on the boundary, values of oneor more neighboring pixels, a reference picture index, information onwhether the boundary corresponds to luma components, a type of a chromacomponent, the length of the boundary, and attributes of a block towhich the boundary belongs.

On the other hand, when the current boundary is determined not to be aboundary to which in-loop filtering is applied, in-loop filtering maynot be applied to the current boundary (S1830).

ON/OFF information on application of in-loop filtering may be signaledusing a bit-stream at any level of various levels such as a sequencelevel, a picture level, a slice level, a tile level, a block level, acoding unit group level, a coding unit level, and a sub-coding unitlevel. Although ON is set for an upper level, selective application maybe performed at a lower level according to the ON/OFF information. ONinformation indicating that in-loop filtering is applied to both of thecoding block boundary and the virtual block boundary may be signaled ata video sequence level. OFF information indicating that in-loopfiltering is applied to neither the coding block boundary nor thevirtual block boundary within a specific picture may be signaled.

When the size of a virtual block is equal to one pixel size, the pixelsconstituting the respective virtual blocks may have different motionvectors. In this case, application of the in-loop filtering to thevirtual block boundaries may be skipped. In addition, as illustrated inFIG. 17(b), when an application range for in-loop filtering extends overtwo boundaries, application of in-loop filtering to one of the twoboundaries may be skipped. In some cases, in-loop filtering may beapplied only to the coding block boundaries and application of in-loopfiltering to the virtual block boundaries may be selectively skipped.

FIG. 19 illustrates a method of applying in-loop filtering to a boundaryof a geometrical shape, according to one embodiment to which the presentinvention is applied.

The boundary may have an arbitrary shape other than a rectangleaccording to a block partitioning structure illustrated in FIGS. 10(f)and 10(g). In this case, as illustrated in FIG. 19, in-loop filteringmay be applied. FIGS. 19(a) and 19(b) illustrate block boundaries andFIGS. 19(c) and 19(d) are enlarged views thereof. In FIGS. 19(c) and19(d), a square block represents a pixel. The in-loop filtering isapplied for every two pixels at the boundary. The shape of the boundaryand the filter application range may vary from embodiment to embodiment.For example, as illustrated in FIG. 19(a), a rectangular block can bedivided into two triangular blocks by a diagonal line. As describedabove with reference to FIG. 10, two triangular blocks can beinter-predicted respectively by using different motion information (forexample, motion vectors, prediction directions, reference pictures,etc.). When a rectangular block is divided into two triangular blocks bya diagonal line, it can be divided in two directions. One direction isillustrated in FIG. 19(a). The other division direction means a divisionby a diagonal line extending from the bottom left corner to the topright corner. Accordingly, when a rectangular block is divided into twotriangular blocks, information on the division direction is signaled. Afinal prediction bock is generated on the basis of two prediction blocksgenerated through inter predictions. In this case, pixels within apredetermined range from the diagonal line may be filtered. In FIG.19(c), the predetermined range means two pixels. However, thepredetermined range is not limited to two pixels. That is, thepredetermined range can be three pixels. The filtering is performed byplacing different weights on the respective prediction samples accordingto the distance from a corresponding pixel to the diagonal line withineach of the two prediction blocks.

Although exemplary methods of the present disclosure are represented ina series of steps for clarity of a description, the exemplary methodsare not intended to limit the sequence of steps. Some steps may beperformed simultaneously or may be performed in a different order asnecessary. In order to implement the method presented by the presentdisclosure, an additional step may be added to the exemplary method,some steps in the exemplary method may be omitted, or some steps in theexemplary method are omitted and an additional step may be added to theexemplary method.

The various embodiments in the present disclosure are not intended toshow all possible combinations but are intended to show only somerepresentative aspects of the present disclosure. Elements described invarious embodiments may be independently applied or may be used incombination of two or more of them.

In addition, various embodiments of the present disclosure may beimplemented by a hardware module, a software module, or a combinationthereof. A hardware implementation may mean implementation by one ormore application specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), general processors, controllers, microcontrollers, ormicroprocessors.

The scope of the present disclosure includes software ormachine-executable commands (for example, operating systems,applications, firmware, programs, etc.) causing methods of variousembodiments to be executed on a device or a computer, and anon-transitory computer-readable medium in which such software ormachine-executable commands are stored so as to be executable on adevice or a computer.

INDUSTRIAL APPLICABILITY

The present invention may be used to encode/decode a video signal.

What is claimed is:
 1. A video decoding method comprising: performingfirst intra prediction on a first sub-block within a current block,using one or more reference pixels of the current block; performingsecond intra prediction on a second sub-block neighboring to the firstsub-block within the current block, using at least one of the referencepixels of the current block or one or more reconstructed pixels of thefirst sub-block, the reconstructed pixels being generated based on anoutput of the first intra prediction; and reconstructing the currentblock based on the predicted first sub-block and the predicted secondsub-block.
 2. The video decoding method of claim 1, wherein the currentblock includes a plurality of sub-blocks, a number of the sub-blocksbeing determined based on a size of the current block.
 3. The videodecoding method of claim 1, wherein the current block includes aplurality of sub-blocks, a shape of each of the sub-blocks beingdetermined based on an intra prediction mode of the current block.
 4. Avideo encoding method comprising: performing first intra prediction on afirst sub-block within a current block, using one or more referencepixels of the current block; performing second intra prediction on asecond sub-block neighboring to the first sub-block within the currentblock, using at least one of the reference pixels of the current blockor one or more reconstructed pixels of the first sub-block, thereconstructed pixels being generated based on an output of the firstintra prediction; and encoding intra prediction information related tothe first intra prediction and the second intra prediction, into abitstream.
 5. The video encoding method of claim 4, wherein the currentblock includes a plurality of sub-blocks, a number of the sub-blocksbeing determined based on a size of the current block.
 6. The videoencoding method of claim 4, wherein the current block includes aplurality of sub-blocks, a shape of each of the sub-blocks beingdetermined based on an intra prediction mode of the current block.
 7. Anon-transitory computer readable recording medium storing a bitstreamgenerated by a video encoding method, the video encoding methodcomprising: performing first intra prediction on a first sub-blockwithin a current block, using one or more reference pixels of thecurrent block; performing second intra prediction on a second sub-blockneighboring to the first sub-block within the current block, using atleast one of the reference pixels of the current block or one or morereconstructed pixels of the first sub-block, the reconstructed pixelsbeing generated based on an output of the first intra prediction; andencoding intra prediction information related to the first intraprediction and the second intra prediction, into a bitstream.